package com.mdd.service.pay;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.domain.*;
import com.alipay.api.request.AlipayTradeCreateRequest;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.alipay.api.response.*;

/**
 * 支付操作
 * <p>
 * {@code @Description}
 * @Author 幻速
 * {@code @Date} 2023/10/30 17:40
 **/
public interface AlipayTradeOrderService {
    /**
     * 小程序创建订单
     * @param alipayTradePayModel 预授权参数
     * @return AlipayTradePayResponse
     */
    AlipayTradeCreateResponse tradePay(AlipayClient alipayClient, AlipayTradeCreateModel alipayTradePayModel, String notifyUrl) throws AlipayApiException;

    /**
     * 小程序退款
     */
    AlipayTradeRefundResponse refund(AlipayClient alipayClient,AlipayTradeRefundModel alipayTradeRefundModel) throws AlipayApiException;

    /**
     * 统一收单交易查询
     * @return AlipayTradeQueryResponse
     */
    AlipayTradeQueryResponse tradeQuery(AlipayClient alipayClient, AlipayTradeQueryModel tradeQueryModel, String notifyUrl) throws AlipayApiException;


    /**
     * 手机网站支付
     * @param alipayClient
     * @param alipayTradeWapPayModel
     * @param notifyUrl
     * @return
     * @throws AlipayApiException
     */
    AlipayTradeWapPayResponse tradePay(AlipayClient alipayClient, AlipayTradeWapPayModel alipayTradeWapPayModel, String notifyUrl,String returnUrl) throws AlipayApiException;


    AlipayTradePagePayResponse tradePay(AlipayClient alipayClient, AlipayTradePagePayModel  alipayTradePagePayModel, String notifyUrl) throws AlipayApiException;

    }
